package my.sorter.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sun.tools.corba.se.idl.constExpr.BooleanAnd;
import my.sorter.bean.CaseDetail;
import my.sorter.bean.EmergencyCase;
import my.sorter.bean.MyEmail;
import my.sorter.bean.filter.DetailFilter;
import my.sorter.bean.filter.EmergencyCaseFilter;
import my.sorter.dao.model.Detail;
import my.sorter.dao.model.Diagnoses;
import org.assertj.core.util.diff.myers.MyersDiff;
import org.springframework.boot.jackson.JsonObjectDeserializer;

import java.util.List;

/**
 * 分检功能模块
 *
 * @author zyf10
 */
public interface SortService {
    /**
     * 新建病情库病情
     *
     * @param detail
     * @return
     */
    Boolean createDetail(Detail detail);

    /**
     * 更新病情库病情
     *
     * @param detail
     * @return
     */
    Boolean updateDetail(Detail detail);

    /**
     * 获取病情库所有病情
     *
     * @return
     */
    List<Detail> getDetails(DetailFilter filter);

    /**
     * 删除病情库某个病情
     *
     * @param ids
     * @return
     */
    Boolean deleteDetail(List<String> ids);

    /**
     * 创建新的患者记录并导入社保和身份证信息
     *
     * @param diagnoses
     * @return
     */
    Boolean createDiagnoses(Diagnoses diagnoses);

    /**
     * 新增或更新病例的病情评估信息
     * @param diagnosesId
     * @param caseDetails
     * @return
     */
    Boolean diseaseJudge(String diagnosesId, List<JSONObject> caseDetails);

    /**
     * 删除病例的病情评估信息
     *
     * @param diagnosesId
     * @return
     */
    Boolean deleteDiseaseJudge(String diagnosesId);

    /**
     * 新增或者更新病例的护理评估信息
     *
     * @param diagnoses
     * @return
     */
    Boolean signJudge(Diagnoses diagnoses);

    /**
     * 清空病例的护理评估信息
     *
     * @param diagnosesId
     * @return
     */
    Boolean removeSignJudge(String diagnosesId);

    /**
     * 查询病例完整信息
     *
     * @param emergencyCaseFilter
     * @return
     */
    List<EmergencyCase> getDiagnoses(EmergencyCaseFilter emergencyCaseFilter);

    /**
     * 关闭病例
     * @param ids
     * @return
     */
    Boolean closeDiagnoses(List<String> ids);

    /**
     * 更新病例基本信息
     * @param diagnoses
     * @return
     */
    Boolean updateDiagnosesBasic(Diagnoses diagnoses);

    /**
     * 发送邮件
     * @param email
     * @return
     */
    Boolean sendEmail(MyEmail email);

    /**
     * 计算就诊顺序
     * @param idNumber
     * @return
     */
    Integer calculateOrder(String idNumber);
}
